#if !defined(AFX_MAINTREEVIEW_H__A8CC6BF3_59AB_45C6_927B_BBDD0001A0C0__INCLUDED_)
#define AFX_MAINTREEVIEW_H__A8CC6BF3_59AB_45C6_927B_BBDD0001A0C0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MainTreeView.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CMainTreeView view

// Tree view item level 
#define TVIL_UNKNOW                 0
#define TVIL_ROOT                   1
#define TVIL_COALMINELIST           11
#define TVIL_COALMINE               111
#define TVIL_USERDEFINEDDISPLAYLIST 12
#define TVIL_USERDEFINEDDISPLAY     121
#define TVIL_ALARMDATA              13

class CMainTreeView : public CTreeView
{
protected:
	CMainTreeView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CMainTreeView)

// Attributes
public:

// Operations
public:
  void ConnectionStatusChanged(long nCoalMineId);
  int GetItemLevel(HTREEITEM hItem);
  HTREEITEM GetItemByLevel(int nLevel, void * pSomething = NULL);

protected:
  HTREEITEM GetCoalMineListItem() const;
  HTREEITEM GetUserDefinedDisplayListItem() const;
  HTREEITEM GetAlarmDataItem() const;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainTreeView)
	public:
	virtual void OnInitialUpdate();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CMainTreeView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	CImageList * m_pImageList;

	// Generated message map functions
protected:
	//{{AFX_MSG(CMainTreeView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINTREEVIEW_H__A8CC6BF3_59AB_45C6_927B_BBDD0001A0C0__INCLUDED_)
